<template>
  <common-page
    ref="commonPage"
    :bg-path="bgPath"
    :web-path="webPath"
    :columns="columns"
    :search-items="searchItems"
    :form-items="formItems"
    page-type="commonPage"
  />
</template>
<script>
export default {
  data() {
    return {
      // ===== ===== ===== ===== 全局属性 ===== ===== ===== =====
      // 后台接口路径
      bgPath: 'base/user/robot/machinetype',
      // Web路径
      webPath: 'base/user/robot/MachineType',
      // ===== ===== ===== ===== 页面配置 ===== ===== ===== =====
      // 搜索内容
      searchItems: [
        {
          rowIndex: 1,
          items: [
            {
              code: "code",
              name: "编码",
              span: 6,
              type: "text",
              config: {
                edit: false
              }
            },
            {
              code: "name",
              name: "名称",
              type: "text",
              span: 6,
              config: {
                edit: false
              }
            },
            {
              code: "type",
              name: "类型",
              type: "select",
              span: 6,
              config: {
                edit: false,
                keyField: "key",
                valueField: "value",
                options: [
                  { key: "1", value: "血压计" },
                  { key: "2", value: "电子锁" },
                  { key: "3", value: "血氧仪" },
                  { key: "4", value: "血糖仪" },
                  { key: "5", value: "体脂秤" }
                ]
              }
            }
          ]
        }
      ],
      // 列表内容
      columns: [
        {
          code: "code",
          name: "编码",
          span: 6,
          type: "text",
          config: {
            edit: false
          }
        },
        {
          code: "name",
          name: "名称",
          type: "text",
          span: 6,
          config: {
            edit: false
          }
        },
        {
          code: "type",
          name: "类型",
          type: "select",
          span: 6,
          config: {
            edit: false,
            keyField: "key",
            valueField: "value",
            options: [
              { key: "1", value: "血压计" },
              { key: "2", value: "电子锁" },
              { key: "3", value: "血氧仪" },
              { key: "4", value: "血糖仪" },
              { key: "5", value: "体脂秤" }
            ]
          }
        }, {
          code: "btDefaultName",
          name: "蓝牙默认名称",
          type: "text",
          span: 6,
          config: {
            edit: false
          }
        }, {
          code: "defaultName",
          name: "设备默认名称",
          type: "text",
          span: 6,
          config: {
            edit: false
          }
        }, {
          code: "model",
          name: "型号",
          type: "text",
          span: 6,
          config: {
            edit: false
          }
        }, {
          code: "manufacturer",
          name: "厂商名称",
          type: "text",
          span: 6,
          config: {
            edit: false
          }
        }, {
          code: "bluetoothVersion",
          name: "蓝牙版本号",
          type: "text",
          span: 6,
          config: {
            edit: false
          }
        }, {
          code: "timeout",
          name: "超时时间",
          type: "number",
          span: 6,
          config: {
            edit: false,
            precision: 2
          }
        }
      ],
      // 增加/修改/详情 表单
      formItems: [
        {
          rowIndex: 1,
          items: [
            {
              code: "code",
              name: "编码",
              span: 6,
              type: "text",
              config: {
                edit: false,
                rules: [
                  { required: true, message: '请输入编码', trigger: 'blur' }
                ]
              }
            },
            {
              code: "name",
              name: "名称",
              type: "text",
              span: 6,
              config: {
                edit: false,
                rules: [
                  { required: true, message: '请输入名称', trigger: 'blur' }
                ]
              }
            },
            {
              code: "type",
              name: "类型",
              type: "select",
              span: 6,
              config: {
                edit: false,
                keyField: "key",
                valueField: "value",
                options: [
                  { key: "1", value: "血压计" },
                  { key: "2", value: "电子锁" },
                  { key: "3", value: "血氧仪" },
                  { key: "4", value: "血糖仪" },
                  { key: "5", value: "体脂秤" }
                ]
              }
            }, {
              code: "btDefaultName",
              name: "蓝牙默认名称",
              type: "text",
              span: 6,
              config: {
                edit: false
              }
            }, {
              code: "defaultName",
              name: "设备默认名称",
              type: "text",
              span: 6,
              config: {
                edit: false
              }
            }, {
              code: "model",
              name: "型号",
              type: "text",
              span: 6,
              config: {
                edit: false
              }
            }, {
              code: "manufacturer",
              name: "厂商名称",
              type: "text",
              span: 6,
              config: {
                edit: false
              }
            }, {
              code: "bluetoothVersion",
              name: "蓝牙版本号",
              type: "text",
              span: 6,
              config: {
                edit: false
              }
            }, {
              code: "timeout",
              name: "超时时间",
              type: "number",
              span: 6,
              config: {
                edit: false,
                precision: 2
              }
            }
          ]
        }
      ]
    }
  }
}
</script>
